<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<style>
			.outer {
				position: relative;
				font-size: 50px;
				display: flex;
				width: 200px;
				height: 200px;
				border: 1px solid red;
			}

			.aaa {
				flex: 1;
				background: black;
			}

			.bbb {
				flex: 1;
				background: white;
			}

			.xxx {
				position: absolute;
				top: 50%;
				/* 关键代码  表示和背景rgb去差值*/
				mix-blend-mode: difference;
				color: #fff;
			}
		</style>
	</head>

	<body>
		<!-- 实现白底黑子，黑底白字 -->
		<div class="outer">
			<div class="aaa"></div>
			<div class="bbb"></div>

			<div class="xxx">1234567890</div>
		</div>
	</body>
</html>
